home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
varia
/
egebook.lha
/
ege.book
/
5
/
Schedule.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-07
|
1KB
|
55 lines
#include <iostream.h>
#include <bool.h>
#include "Schedule.h"
#include "Example.h"
#include "Collection.h"
#include "Course.h"
#include "Professor.h"
#include "TeachingAssistant.h"
#include "ScheduledCourse.h"
Collection* Schedule::All = new Collection;
void Schedule::maintain(){
String selection;
while (TRUE) {
cout << "assign (a) new course or maintain (m) ? ";
cin >> selection;
if (selection.contains("a"))
assign();
else if (selection.contains("m")) {
cout << "these courses are offered:\n";
offerings->maintain();
} else
break;
};
}
void Schedule::assign() {
Example *selection;
ScheduledCourse *schedCourse;
cout << "select a course:\n";
if ((selection = Course::All->select()) != NULL) {
schedCourse = new ScheduledCourse(selection);
cout << "enter time: ";
cin >> schedCourse->time;
cout << "select a teacher:\n";
if ((selection=Professor::All->select()) != NULL) {
schedCourse->teacher = selection;
cout << "select first teaching assistant:\n";
if ((selection=TeachingAssistant::All->select()) != NULL) {
schedCourse->assistants[0] = selection;
cout << "select second teaching assistant:\n";
if ((selection=TeachingAssistant::All->select()) != NULL) {
schedCourse->assistants[1] = selection;
if (schedCourse->check())
offerings->add(schedCourse);
};
};
};
};
}